<?php

namespace IDock\Insurance\AMIC\Response;

use IDock\Http\Response;
use IDock\IDock\IDockEnums;
use IDock\Insurance\AMIC\AMICEnums;
use IDock\Insurance\AMIC\Response\AllAMICResponse;
use IDock\Printer\VehicleModelPrinter;
use IDock\Printer\VehiclePrinter;

class VehicleConfirmResponse extends AllAMICResponse
{

    /**
     * @var VehicleModelPrinter $printer
     */
    public $printer = VehicleModelPrinter::class;

    public function printerInit(): Response
    {
        $body = $this->getBody()['Body'] ?? [];
        $modelList = $body['vehicleModelList'] ?? [];
        if (!$modelList) {
            return $this;
        }
        $model = $modelList['vehicleModel'] ?? [];
        $vehiclePrinter = new VehiclePrinter();
        $vehiclePrinter->item['vehiclePlatId'] = $model['vehiclePlatId'] ?? '';
        $vehiclePrinter->item['actualPrice'] = $model['acturalPrice'] ?? '';
        $this->printer->setModelList($vehiclePrinter);
        return $this;
    }


}
